Skip to content

Clean up MAUI .NET 10 warnings#1805

Merged
praveenaak merged 2 commits into
v.nextfrom
prav/maui-net10-warning-cleanup
May 22, 2026
Merged

Clean up MAUI .NET 10 warnings#1805
praveenaak merged 2 commits into
v.nextfrom
prav/maui-net10-warning-cleanup

Conversation

@praveenaak

@praveenaak praveenaak commented May 19, 2026

Copy link
Copy Markdown
Collaborator

Description

Address MAUI build warnings under .NET 10.

Type of change

  • Other enhancement

Platforms tested on

  • MAUI WinUI
  • MAUI Android
  • MAUI iOS
  • MAUI MacCatalyst

Checklist

  • Self-review of changes
  • All changes work as expected on all affected platforms
  • There are no warnings related to changes
  • Code is commented and follows .NET conventions and standards
  • Codemaid and XAML styler extensions have been run on every changed file
  • No unrelated changes have been made to any other code or project files

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Cleans up MAUI .NET 10 build warnings by migrating away from APIs that became obsolete (synchronous DisplayAlert/DisplayActionSheet) and from controls that are deprecated (ListView, ViewCell, TextCell, ImageCell, SwitchCell, SelectedItemChangedEventArgs, MediaPicker.PickPhotoAsync).

Changes:

  • Renamed DisplayAlertDisplayAlertAsync and DisplayActionSheetDisplayActionSheetAsync across all samples, the Settings page, the SamplePage, and helpers; some fire‑and‑forget calls were rewritten with _ =.
  • Replaced ListView (with ViewCell/TextCell/ImageCell/SwitchCell item templates) with CollectionView plus equivalent DataTemplates, and updated the corresponding code‑behind handler signatures from SelectedItemChangedEventArgs to SelectionChangedEventArgs (using e.CurrentSelection.FirstOrDefault()).
  • Misc.: MediaPicker.PickPhotoAsyncPickPhotosAsync().FirstOrDefault(); rewrote ChangeSublayerVisibility sublayers page using CollectionView + Switch; reworked SimulatedDataSource.ProcessNextObservation to use a nullable‑bool end‑of‑stream signal.

Reviewed changes

Copilot reviewed 169 out of 169 changed files in this pull request and generated no comments.

Show a summary per file
File Description
src/MAUI/Maui.Samples/Views/SettingsPage.xaml(.cs) ListView→CollectionView for offline data list; DisplayAlertAsync.
src/MAUI/Maui.Samples/Views/SamplePage.xaml.cs DisplayActionSheetAsync.
src/MAUI/Maui.Samples/Helpers/{ArcGISLoginPrompt,FeedbackPrompt,SampleLoader}.cs Async API renames.
src/MAUI/Maui.Samples/Samples/Analysis/** (4 files) DisplayAlertAsync renames.
src/MAUI/Maui.Samples/Samples/Data/** (~20 files) Renames; PickPhotosAsync; ListView→CollectionView in EditFeatureAttachments, CreateMobileGeodatabase, ReadShapefileMetadata.
src/MAUI/Maui.Samples/Samples/Geometry/** DisplayAlertAsync renames.
src/MAUI/Maui.Samples/Samples/Geoprocessing/** DisplayAlertAsync renames.
src/MAUI/Maui.Samples/Samples/GraphicsOverlay/** DisplayAlertAsync renames.
src/MAUI/Maui.Samples/Samples/Layers/** (~30 files) Renames; multiple ListView→CollectionView migrations; SimulatedDataSource end‑of‑stream change; ChangeSublayerVisibility UI rebuilt.
src/MAUI/Maui.Samples/Samples/Location/** DisplayAlertAsync renames.
src/MAUI/Maui.Samples/Samples/Map/** Renames; ListView→CollectionView in SearchPortalMaps, DownloadPreplannedMap, MobileMapSearchAndRoute, MapReferenceScale.
src/MAUI/Maui.Samples/Samples/MapView/** DisplayAlertAsync renames.
src/MAUI/Maui.Samples/Samples/NetworkAnalysis/** Renames; RouteAroundBarriers directions list rebuilt with CollectionView.
src/MAUI/Maui.Samples/Samples/Scene/, SceneView/ DisplayAlertAsync renames.
src/MAUI/Maui.Samples/Samples/Search/** DisplayAlertAsync/DisplayActionSheetAsync renames.
src/MAUI/Maui.Samples/Samples/Security/** Renames.
src/MAUI/Maui.Samples/Samples/Symbology/** Renames; SymbolsFromMobileStyle ListViews replaced with CollectionViews.
src/MAUI/Maui.Samples/Samples/UtilityNetwork/** Renames; PerformValveIsolationTrace TerminalPicker switched to CollectionView.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@praveenaak praveenaak self-assigned this May 19, 2026

@imalcolm1 imalcolm1 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good! One small regression with the portal maps not scrolling and a couple optional nits

@praveenaak praveenaak requested a review from imalcolm1 May 21, 2026 22:41
@praveenaak praveenaak merged commit 5aec554 into v.next May 22, 2026
2 checks passed
@praveenaak praveenaak deleted the prav/maui-net10-warning-cleanup branch May 22, 2026 19:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants